#include <stdio.h>
#include <stdlib.h>
#include <string.h>


char DU = 0;
char WE = 0;
char P0 = 0;

char Num[10] = { 0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F };

void PrintNum(int num)
{
	int result[8] = { 0 };
	int i = 7;
	char flag = 0;
	char tmp = 0xFF;
	char loc = 0x01;
	while (num > 0)
	{
		result[i--] = num % 10;
		num /= 10;
	}
	for (i = 0; i < 8; i++)
	{
		if (result[i] != 0)
		{
			flag = 1;
		}
		if (flag != 0)
		{
			WE = 0;
			P0 = tmp ^ loc;
			WE = 1;
			printf("%x:%d\n",P0,result[i]);
			DU = 0;
			P0 = Num[result[i]];
			DU = 1;
			loc <<= 1;
		}
	}
}
int main()
{
	PrintNum(28982395);
	return 0;
}

/**
 * Return an array of arrays of size *returnSize.
 * The sizes of the arrays are returned as *returnColumnSizes array.
 * Note: Both returned array and *columnSizes array must be malloced, assume caller calls free().
 */
//int Find(int** mat, int x, int y, int col, int row,int oldx,int oldy)
//{
//	if (x <= 0 || y <= 0 || x >= col - 1 || y >= row - 1 || mat[x][y] == 0)
//		return 0;
//	int tmp[4] = 0;
//	//tmp
//}
//int** updateMatrix(int** mat, int matSize, int* matColSize, int* returnSize, int** returnColumnSizes) 
//{
//	*returnSize = matSize;
//	if (mat == NULL)
//		return NULL;
//	for (int i = 0; i < matSize; i++)
//	{
//		for (int j = 0; j < matColSize[0]; j++)
//		{
//			if (mat[i][j] == 0)
//				returnColumnSizes[i][j] = 0;
//			else
//				returnColumnSizes[i][j] = Find(mat, i, j, matSize, matColSize[0],i,j);
//		}
//	}
//	return returnColumnSizes;
//}